package com.xuzhen.init.impl;

import com.xuzhen.domain.User;
import com.xuzhen.init.Initialization;
import com.xuzhen.service.UserService;

public class UserInitialization implements Initialization {
	private UserService userService;

	public UserInitialization() {

	}

	public UserInitialization(UserService userService) {
		this.userService = userService;
	}

	@Override
	public void init() {
		addUser("xuzhen", "xuzhen123", "nihaosha");
	}

	private void addUser(String userName, String password, String remark) {
		User user = new User();
		user.setUserName(userName);
		user.setPassword(password);
		user.setRemark(remark);
		userService.insert(user);
	}

}
